import { createBrowserRouter } from 'react-router-dom'
import { lazy } from 'react'
import {
    MenuFoldOutlined,
    MenuUnfoldOutlined,
    UploadOutlined,
    UserOutlined,
    VideoCameraOutlined,
} from '@ant-design/icons';

const Home = lazy(() => import('../page/home/Index'))
const Home1 = lazy(() => import('../page/home1/Index'))
const Data = lazy(() => import('../page/data/Index'))
const Login = lazy(() => import('../page/login/Index'))
const Child = lazy(() => import('../page/child/Index'))
const ChildPage = lazy(() => import('../page/childPage/Index'))
const List = lazy(() => import('../page/list/Index'))
const List1 = lazy(() => import('../page/list1/Index'))
const List2 = lazy(() => import('../page/list2/Index'))
const Form = lazy(() => import('../page/form/Index'))
const Detail = lazy(() => import('../page/detail/Index'))
const Ok = lazy(() => import('../page/ok/Index'))
const No = lazy(() => import('../page/no/Index'))
const People = lazy(() => import('../page/prople/Index'))
const App = lazy(() => import('../App'))

export const routesItem = [
    {
        path: '/home',
        element: <Home />,
        icon: <UserOutlined />,
        label: '仪表盘',
        children: [
            {
                path: '/home/home1',
                element: <Home1 />,
                label: '仪表盘一'
            }
        ]
    },
    {
        path: '/data',
        element: <Data />,
        icon: <UploadOutlined />,
        label: '数据可视化',
        children: [
            {
                path: '/data/childPage',
                element: <ChildPage />,
                label: '分析页'
            },
            {
                path: '/data/child',
                element: <Child />,
                label: '多维数据分析'
            },
        ]
    },
    {
        path: '/list',
        element: <List />,
        icon: <UploadOutlined />,
        label: '列表页',
        children: [
            {
                path: '/list/list1',
                element: <List1 />,
                label: '查询表格'
            },
            {
                path: '/list/list2',
                element: <List2 />,
                label: '卡片列表'
            },
        ]
    },
    {
        path: '/form',
        element: <Form />,
        icon: <MenuUnfoldOutlined />,
        label: '表单页',
        children: [
            {
                path: '/form/form1',
                element: <></>,
                label: '查询表格'
            }
        ]
    },
    {
        path: '/detail',
        element: <Detail />,
        icon: <MenuUnfoldOutlined />,
        label: '详情页',
        children: [
            {
                path: '/detail/detail1',
                element: <></>,
                label: '查询表格'
            }
        ]
    },
    {
        path: '/ok',
        element: <Ok />,
        icon: <MenuUnfoldOutlined />,
        label: '结果页',
        children: [
            {
                path: '/ok/ok1',
                element: <></>,
                label: '查询表格'
            }
        ]
    },
    {
        path: '/no',
        element: <No />,
        icon: <MenuUnfoldOutlined />,
        label: '异常页',
        children: [
            {
                path: '/no/no1',
                element: <></>,
                label: '查询表格'
            }
        ]
    },
    {
        path: '/prople',
        element: <People />,
        icon: <MenuUnfoldOutlined />,
        label: '个人中心',
        children: [
            {
                path: '/prople/prople1',
                element: <></>,
                label: '查询表格'
            }
        ]
    },
]

const routes = [
    {
        path: '/',
        element: <App />,
        children: routesItem
    },
    {
        path: '/login',
        element: <Login />
    }
]

const router = createBrowserRouter(routes)
export default router